import request from '@/utils/request'
const api_name='/orderservice/order'

export default {

  //1、创建订单
  createOrder(type,cid) {
    return request({
      url: `${api_name}/createOrder/${type}/${cid}`,
      method: 'post'
    })
  },
  //2、根据id获取订单
  getById(cid) {
    return request({
      url: `${api_name}/getOrder/${cid}`,
      method: 'get'
    })
  },
  //3、生成微信支付二维码
  createNative(cid) {
    return request({
      url: `${api_name}/createNative/`+cid,
      method: 'get'
    })
  },
  //4、根据id获取订单支付状态
  queryPayStatus(cid) {
    return request({
      url: `${api_name}/queryPayStatus/`+cid,
      method: 'get'
    })
  },
  //支付宝
  createNativeByAliPay(cid) {
    return request({
      url: `${api_name}/createNativeByAlipay/`+cid,
      method: 'get'
    })
  },
  //查询支付宝支付状态
  queryPayStatusByAliPay(cid) {
    return request({
      url: `${api_name}/queryPayStatusByAlipay/`+cid,
      method: 'get'
    })
  },
  getList(status){
    return request({
      url: `${api_name}/getList/`+status,
      method: 'get'
    })
  }
}
